package com.cz.kingdee.test;

import com.cz.kingdee.KingdeeClient;
import com.cz.kingdee.dto.ManufactureOrderDetail;
import com.kingdee.bos.webapi.entity.QueryParam;
import com.kingdee.bos.webapi.sdk.K3CloudApi;

import java.util.List;

public class JdManufactureOrder {

    public static void main(String[] args) {
        try {
            KingdeeClient kingdeeClient = new KingdeeClient();
            K3CloudApi k3CloudApi = kingdeeClient.getTestKingdeeClient();

            QueryParam queryParam = new QueryParam();
            queryParam.setFormId("PRD_MO");
            queryParam.setFieldKeys("FID,FBillNo,FMaterialId,FMaterialName,FSpecification,FProductType,FQty");
            queryParam.setStartRow(0);
            queryParam.setLimit(10);
            List<ManufactureOrderDetail> result = k3CloudApi.executeBillQuery(queryParam, ManufactureOrderDetail.class);
            for (ManufactureOrderDetail manufactureOrderDetail : result) {
                System.out.println(manufactureOrderDetail.getFID()+"-"+manufactureOrderDetail.getFBillNo()+"-"+manufactureOrderDetail.getFMaterialId()
                +"-"+manufactureOrderDetail.getFMaterialName()+"-"+manufactureOrderDetail.getFSpecification()+"-"+manufactureOrderDetail.getFProductType()+"-"+manufactureOrderDetail.getFQty());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
